package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.view.View;
import android.widget.Button;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * 确认验钞界面
 */
public class CounterfeitCurrencyDetectionPp extends BasePopupView {
    Unbinder bind;
    @BindView(R.id.okbtn)
    Button okbtn;

    CounterfeitCurrencyDCallBack mCounterfeitCurrencyDCallBack;

    public CounterfeitCurrencyDetectionPp(@NonNull Context context, CounterfeitCurrencyDCallBack counterfeitCurrencyDCallBack) {
        super(context);
        mCounterfeitCurrencyDCallBack = counterfeitCurrencyDCallBack;
    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.counterfeit_currency_detection_layout;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        bind = ButterKnife.bind(this);
        okbtn.setOnClickListener(v -> {
            mCounterfeitCurrencyDCallBack.CounterfeitCurrencyD();
        });
    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }

    public interface CounterfeitCurrencyDCallBack {
        void CounterfeitCurrencyD();
    }
}
